package com.foreveross.fetl.core.domain.freight.hbase;

import javax.persistence.ManyToOne;

import com.foreveross.fetl.common.domain.BaseHBaseEntity;
import com.foreveross.fetl.common.jpa.annontation.HBaseColumn;


@javax.persistence.Table(name="CRAWL_PLANE_FREIGHT")
public class AgentEntity extends BaseHBaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2993587767621246667L;

	/**
	 * 所属航班
	 */
	@ManyToOne
	private PlaneInfoEntity planeInfoEntity;
	/**
	 * 代理商名称，如：兄弟旅行网
	 */
	@HBaseColumn(qualifier="name",family="agentInfos")
	private String name;
	/**
	 * 代理商公司名称，如：北京天原兄弟旅行社有限公司
	 */
//	@javax.persistence.Column(name="cname",columnDefinition="agentInfos")
//	private String cname;
	/**
	 * 代理商公司地址，如：北京市西城区西直门南
	 */
//	@javax.persistence.Column(name="address",columnDefinition="agentInfos")
	private String address;
	/**
	 * 代理商公司网址，如：xdx.trade.qunar.com
	 */
//	@javax.persistence.Column(name="web",columnDefinition="agentInfos")
//	private String web;
	/**
	 * 代理商公司电话，如：020-36172911
	 */
//	@javax.persistence.Column(name="phone",columnDefinition="agentInfos")
//	private String phone;
	/**
	 * 机票原价
	 */
	@HBaseColumn(qualifier="originalPrice",family="agentInfos", format="#,###")
	private Double originalPrice;
	/**
	 * 机票优惠价
	 */
	@HBaseColumn(qualifier="price",family="agentInfos", format="#,###")
	private Double price;
	/**
	 * 代理商类型
	 * 0 表示直营(如 深航自己的航班) 
	 * 1 表示承运(如 深航飞国航的航班)
	 * 2 表示普通代理(如 携程艺龙淘宝卖票)
	 */
	@HBaseColumn(qualifier="agentType",family="agentInfos")
	private Integer type;
	
	public PlaneInfoEntity getPlaneInfoEntity() {
		return planeInfoEntity;
	}

	public void setPlaneInfoEntity(PlaneInfoEntity planeInfoEntity) {
		this.planeInfoEntity = planeInfoEntity;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getOriginalPrice() {
		return originalPrice;
	}

	public void setOriginalPrice(Double originalPrice) {
		this.originalPrice = originalPrice;
	}


	public Double getPrice() {
		return price;
	}


	public void setPrice(Double price) {
		this.price = price;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("AgentEntity [name=");
		builder.append(name);
		builder.append(", originalPrice=");
		builder.append(originalPrice);
		builder.append(", price=");
		builder.append(price);
		builder.append("]");
		return builder.toString();
	}

	@Override
	public String generateRowKey() {
		return planeInfoEntity.generateRowKey();
	}

}
